package com.shigen.demo.pattern.singleton;

/**
 * 恶汉式单例
 *  优点：简单、线程安全
 *  缺点：单例对象的数量不可控的时候可能造成内存浪费
 * @author shigenfu
 * @date 2022/8/14 11:19 上午
 */
public class HungrySingleton {

  private static final HungrySingleton instance = new HungrySingleton();

  private HungrySingleton() {
  }

  private static HungrySingleton getInstance() {
    return instance;
  }

}
